import { instrction } from "../config.js";
var keys = Object.keys(instrction);
//作弊码
var currentInstrction = "";
export var instrctionFun = function (_a) {
    var key = _a.key;
    currentInstrction += key;
    var len = currentInstrction.length;
    //判断当前字符串是否有匹配指令
    var flag = keys.some(function (k) { return k.slice(0, len) === currentInstrction; });
    //不符合就清空
    if (!flag)
        return (currentInstrction = "");
    keys.forEach(function (key) {
        if (key === currentInstrction) {
            console.log(1);
            var a = instrction;
            a[key]();
            currentInstrction = "";
        }
    });
};
